/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package systole.domain.analysis.results.averages;

import java.io.Serializable;
import java.text.DecimalFormat;

/**
 *
 * @author jmj
 */
public class Average implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = -2854120159032842794L;
    private float avg;
    private float trustInterval;

    /**
     * 
     */
    public Average() {
        this.avg = 0;
        this.trustInterval = 0;
    }

    /**
     * @return the avg
     */
    public float getAvg() {
        return this.avg;
    }

    /**
     * @param avg the avg to set
     */
    public void setAvg(float avg) {
        this.avg = avg;
    }

    /**
     * @return the trustInterval
     */
    public float getTrustInterval() {
        return this.trustInterval;
    }

    /**
     * @param trustInterval the trustInterval to set
     */
    public void setTrustInterval(float trustInterval) {
        this.trustInterval = trustInterval;
    }

    /**
     * @return values as formatted string
     */
    public String getValueAsString() {
        DecimalFormat format = new DecimalFormat("####.00");
        return format.format(this.avg) + " +/-" + format.format(this.trustInterval);
    }
}
